<?php
/**
 *　amfext post
 */

if (isset($_POST['args'])) {
	$args = $_POST['args'];
	$args = pack('C', 0x11) . $args;
	$input = amf_decode($args, AMF_AMF3 | AMF_BIG_ENDIAN);
} else {
	$input = null;
}

$result = array(
	'msg' => 'Hello amfext post !',
	'time' => time()
	);
$result['args'] = $input;

$output = amf_encode($result, AMF_AMF3 | AMF_BIG_ENDIAN);
$output = substr($output, 1);

header('Content-Type: application/x-amf');
echo $output;

